import {Injectable} from '@angular/core';
import {BaseHttpService} from '../base-http.service';
import {Observable} from 'rxjs';

export interface MsdsLaw {
  msdsEntprId?: number;
  id?: number;
  law: string;
  lawDetailList: lawDetailListOTO[];
}

export interface lawDetailListOTO {
  id?: number,
  msdsLawId?: number,
  lawDetail: string;
  remark: string;
}

@Injectable({
  providedIn: 'root'
})
export class MsdsLawHttpService {

  constructor(public http: BaseHttpService) {
  }


  /*新增msdsLaw 信息*/
  public addMsdsLaw(param: MsdsLaw): Observable<number> {
    return this.http.post('/msdsLaw', param, {needSuccessInfo: true});
  }

  /*修改msdsLaw信息*/
  public editMsdsLaw(param: MsdsLaw): Observable<void> {
    return this.http.put('/msdsLaw', param, {needSuccessInfo: true});
  }

  /*查询msdsLaw详情*/
  public getMsdsLawDetail(msdsEntprId: number): Observable<MsdsLaw> {
    return this.http.get('/msdsLaw/' + msdsEntprId);
  }


}
